package com.example.infomanagesystem.common;

import lombok.Getter;

/**
 * 错误码
 *
 * @author Ding xsp
 */

@Getter
public enum ErrorCode {

//    ErrorCode SUCCESS = new ErrorCode(0, "ok", "");

    SUCCESS(200, "ok", ""),
    PARAMS_ERROR(40000, "请求参数错误", ""),
    NULL_ERROR(40001, "请求数据为空", ""),
    NOT_LOGIN(40100, "未登录", ""),
    NO_AUTH(40101, "无权限", ""),
    SYSTEM_ERROR(50000, "系统内部异常", ""),
    PARAMS_NUM_LIMIT_ERROR(40002, "参数数量超过限制","");



    private final int code; //被final修饰 但是只能在构造函数里面修改

    /**
     * 状态码信息
     */
    private final String message;

    /**
     * 状态码描述（详情）
     */
    private final String description;

    ErrorCode(int code, String message, String description) {
        this.code = code;
        this.message = message;
        this.description = description;
    }

}
